home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / pcqpascalv1.2d.lha / Examples2 / PointerLib / Pointer.doc next >
Encoding:
Text File  |  1997-05-06  |  4.8 KB  |  177 lines

  1.  
  2.  
  3.  
  4.              ***       Pointer.library        ***
  5.  
  6.                      written by luke wood
  7.  
  8.  
  9.  
  10.  
  11. "Pointer.library" is a shared disk-based library to provide
  12. programmers with access to an easy custom pointer and a
  13. consistent user selected busy pointer.  Please note that
  14. Pointer.library requires the IFFParse.library to use custom
  15. pointers. { The IFFPasre.library is included within WB 2.0
  16. or higher. }
  17.  
  18. This Archive includes:
  19.     Pointer.doc          => This file
  20.     Pointer.library      => The library (copy to libs:)
  21.     UsePointer           => A sample program
  22.     UsePointer.c         => Source code to the sample program
  23.     Pointer.h            => The prototype file
  24.     Pointer_pragma.h     => The Lattice/SAS-C pragma file
  25.     Pointer.fd           => The .fd file
  26.  
  27. Additionally there are 6 busy pointer images included:
  28.     StopWatch.ilbm       GhostPointer.ilbm
  29.     ZZBubble.ilbm        BusyBee.ilbm
  30.     HourGlass.ilbm       CrossHair.ilbm
  31.  
  32. These files should be copied to the SYS:Prefs/presets drawer. 
  33. Copy ONE of these files to SYS:Prefs/presets/BusyPointer.ilbm,
  34. that will be the busy pointer that applications will get when
  35. they ask for a busy pointer.  (If you are running under WB1.3 or
  36. lower you will have to make the presets drawer, and get a copy of
  37. LIBS:iffparse.library before you can use a custom pointer.) Or
  38. make a custom pointer of your own using the WB2.0 Preferences
  39. Pointer Editor.  You can design a pointer with Dpaint, but be
  40. sure to Load & Save it into the WB2.0 Preferences Pointer Editor
  41. to convert the file to the correct format. Also make sure the Set
  42. Point is in the right place and that the colors are consistent
  43. with your primary pointer.
  44.  
  45. Run "UsePointer" and click in the window to see the pointer
  46. activate.  To see the other pointers, load them into DPaint as
  47. brushes, or into the WB2.0 Pointer Editor.
  48.  
  49. -------------------------------
  50. This archive may be freely redistributed as long as all the files
  51. in this archive are retained. Use of the library is free to all
  52. who wish to use it.
  53.  
  54. This archive and/or its contents may be included in a public
  55. domain library (such as Fred Fish)
  56.  
  57. Your comments and suggestions are welcome, I am available on BIX
  58. as "luke.wood" or through the U.S. Mail as: Luke Wood, P.O. Box
  59. 28622, Santa Ana, CA 92799-8622.
  60.  
  61.  
  62. To use pointer.library in your program...
  63.  
  64. Open the pointer library.
  65.  
  66.     PointerBase = OpenLibrary( "pointer.library", 36 );
  67.     if( PointerBase == NULL )
  68.     {
  69.         printf( "Pointer Open failed\n" );
  70.         exit( FALSE );
  71.     }
  72.  
  73. To load a custom pointer specify the pointer file to load.
  74.  
  75.     MyPointer = LoadPointer( "SYS:Prefs/presets/CrossHair.ilbm" );
  76.  
  77. To use the pointer call the Intuition function SetPointer. (You
  78. need to open Intuition First.)
  79.  
  80.     SetPointer( MyWindow, MyPointer->Data,
  81.         MyPointer->Height, MyPointer->Width,
  82.         MyPointer->XOff, MyPointer->YOff );
  83.  
  84. When you want to turn off the pointer, call the Intuition function
  85. ClearPointer().
  86.  
  87.     ClearPointer( (struct Window*)MyWindow );
  88.  
  89. When your program is done with the pointer, free it by calling FreePointer().
  90.  
  91.     if( MyPointer )
  92.         FreePointer( MyPointer );
  93.  
  94. If you need a busy pointer call SetBusyPointer() with your window
  95. pointer.
  96.  
  97.     SetBusyPointer( (struct Window*)MyWindow );
  98.  
  99. When you are done with the busy pointer clear it, with the
  100. intuition function ClearPointer()
  101.  
  102.     ClearPointer( (struct Window*)MyWindow );
  103.  
  104. The busy pointer will remain in memory as long as the library is
  105. loaded.  All of the programs that call SetBusyPointer will get
  106. the same busy pointer image.
  107.  
  108. Please be sure to close the library when you are done with it.
  109.  
  110.     if( PointerBase )
  111.         CloseLibrary( PointerBase );
  112.  
  113.  
  114. =======================
  115. LoadPointer
  116.  
  117.     NAME
  118.         LoadPointer -- allocate memory and read a pointer file.
  119.  
  120.     SYNOPSIS
  121.         pointer = LoadPointer(filename)
  122.                               A0
  123.  
  124.     FUNCTION
  125.         This routine reads in a preferences pointer file and
  126.         allocates memory as required.
  127.  
  128.     INPUTS
  129.         filename -- the name of the file. If the filename does not
  130.         specify the path, then the file must reside in the current
  131.         directory.
  132.  
  133.     RESULTS
  134.         pointer -- a pointer to a Pointer structure if successful,
  135.         else zero
  136.  
  137. =======================
  138. FreePointer
  139.  
  140.     NAME
  141.         FreePointer -- free memory for a previously loaded pointer.
  142.  
  143.     SYNOPSIS
  144.         FreePointer( pointer )
  145.                      A0
  146.  
  147.     FUNCTION
  148.         This routine frees the memory that was allocated by a
  149.         call to LoadPointer().
  150.  
  151.     INPUTS
  152.         pointer -- a pointer to the Pointer structure
  153.  
  154.     RESULTS
  155.         None
  156.  
  157. =======================
  158. SetBusyPointer
  159.  
  160.     NAME
  161.         SetBusyPointer -- set a window to the user selected busy pointer.
  162.  
  163.     SYNOPSIS
  164.         SetBusyPointer( window )
  165.                         A0
  166.  
  167.     FUNCTION
  168.         This routine sets up the window with the pointer that is set in
  169.         "SYS:Prefs/presets/BusyPointer.ilbm" file.
  170.  
  171.     INPUTS
  172.         window -- a pointer to the structure of the Window to get
  173.         the busy pointer.
  174.  
  175.     RESULTS
  176.         None
  177.